package org.linlinjava.litemall.wx.vo.cart;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.linlinjava.litemall.db.domain.LitemallTax;
import org.linlinjava.litemall.db.domain.LumiereCartGoodsProperty;

import java.math.BigDecimal;
import java.util.List;

@Data
@ApiModel(value="购物车添加商品请求类",description="购物车添加商品请求类")
public class CartListRespVO {

	@ApiModelProperty(value = "id")
	private Integer id;

	@ApiModelProperty(value = "价格")
	private BigDecimal price;

	@ApiModelProperty(value = "优惠后价格")
	private BigDecimal afterDiscountPrice;

	@ApiModelProperty(value = "类型")
	private Integer type;

	@ApiModelProperty(value = "商品")
	private CartGoodsRespVO cartGoods;

	@ApiModelProperty(value = "套餐")
	private CartPackageRespVO cartListPackage;




	@Data
	@ApiModel(value="购物车添加商品请求类",description="购物车添加商品请求类")
	public static class CartGoodsRespVO {

		@ApiModelProperty(value = "id")
		private Integer id;

		@ApiModelProperty(value = "数量")
		private Integer number;

		@ApiModelProperty(value = "价格")
		private BigDecimal price;

		@ApiModelProperty(value = "商品id")
		private Integer goodsId;

		@ApiModelProperty(value = "税价")
		private BigDecimal taxPrice = BigDecimal.ZERO;

		@ApiModelProperty(value = "税")
		private List<CartListGoodsTaxRespVO> goodsTaxList;

		@ApiModelProperty(value = "商品名称")
		private String name;

		@ApiModelProperty(value = "图片")
		private String picUrl;

		@ApiModelProperty(value = "规格id")
		private Integer specificationId;

		@ApiModelProperty(value = "规格名")
		private String specificationsName;

		@ApiModelProperty(value = "属性")
		private List<LumiereCartGoodsProperty> goodsProperties;

		@ApiModelProperty(value = "原料")
		private List<CartListGoodsFormulaSpecificationsDataProportioningRespVO> specificationsDataProportioningList;

	}


	@Data
	@ApiModel(value="购物车添加商品请求类",description="购物车添加商品请求类")
	public static class CartPackageRespVO {
		@ApiModelProperty(value = "id")
		private Integer id;

		@ApiModelProperty(value = "套餐id")
		private Integer packageId;

		@ApiModelProperty(value = "数量")
		private Integer number;

		@ApiModelProperty(value = "价格")
		private BigDecimal price;

		@ApiModelProperty(value = "税价")
		private BigDecimal taxPrice = BigDecimal.ZERO;

		@ApiModelProperty(value = "商品名称")
		private String name;

		@ApiModelProperty(value = "图片")
		private String picUrl;

		@ApiModelProperty(value = "商品")
		private List<CartGoodsRespVO> cartListGoodsList;

	}

	@Data
	@ApiModel(value="购物车添加商品请求类",description="购物车添加商品请求类")
	public static class CartListGoodsFormulaSpecificationsDataProportioningRespVO {

		@ApiModelProperty(value = "id")
		private Integer id;

		@ApiModelProperty(value = "原料")
		private Integer formulaSpecificationsDataProportioningId;

		@ApiModelProperty(value = "数量")
		private Integer quantity;

		@ApiModelProperty(value = "价格")
		private BigDecimal price;

		@ApiModelProperty(value = "原料id")
		private Integer materialId;

		@ApiModelProperty(value = "商品名称")
		private String materialName;

		@ApiModelProperty(value = "制作单位")
		private String makeUnit;

	}

	@Data
	@ApiModel(value="商品税")
	public static class CartListGoodsTaxRespVO {
		@ApiModelProperty(value = "税率代码(GST、PST、HST)")
		private String code;
		@ApiModelProperty(value = "税率值")
		private BigDecimal value;
		@ApiModelProperty(value = "税费")
		private BigDecimal price;

	}

}
